#!/bin/bash
OK=0
WARN=1
CRITICAL=2
UNKNOWN=3
PATH="/bin:/sbin:/usr/bin:/usr/sbin"

#touch /usr/lib64/nagios/plugins/diskmonitor
touch /scratch/testfs
if [ -w /usr/lib64/nagios/plugins/diskmonitor ]
then
	if [ -w /scratch/testfs ]
	then
        	echo " local disk and scratch can write"
		exit $OK
	else
		echo " scratch disk only read"
		exit $CRITICAL
	fi
else
        if [ -w /scratch/testfs ]
        then
                echo " local disk only read"
                exit $CRITICAL
	else
		echo " local disk and scratch only read"
		exit $CRITICAL
	fi
fi
